package com.xiang.mall.platform.uc.client

import com.xiang.mall.platform.uc.config.OAuth2FeignAutoConfiguration
import com.xiang.mall.platform.uc.model.dto.UserInfoDto
import org.springframework.cloud.openfeign.FeignClient
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestParam

/**
 * @author xiangliyou
 * @email xiangliyou1814@mail.yneusoft.com
 * @date 2019-03-12 14:41
 * 用户信息
 */
@FeignClient(name = "uc-service", path = "/uc/userInfo", configuration = [OAuth2FeignAutoConfiguration::class])
interface UserInfoClient {

    /**
     * 添加用户
     */
    @PostMapping("add")
    fun add(@RequestBody user: UserInfoDto): Boolean

    /**
     * 通过用户名查找用户信息
     */
    @GetMapping("findUserByUsername")
    fun findUserByUsername(@RequestParam username: String): UserInfoDto

}